<template>
<div>
  <button @click="addUrlParams">添加url参数</button>
</div>
</template>

<script setup lang="ts">
import { useUrlSearchParams } from '@vueuse/core'

defineOptions({
  name: "UseUrlSearchParams"
})

const addUrlParams = () => {
  const params = useUrlSearchParams('hash')
  params.foo = 'bar'
  params.baz = 'qux'
  params.hello = 'world'
  // params.detailId = ''
  delete params.detailId
}
</script>
